<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>最新动态</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <include file="Public:iframe_header"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/mobile/css/ul-li.css"/>
    <style type="text/css">
    * {
		font-size: 95%;
		font-family: haettenschweiler;
	}
    </style>	
</head>
<body>
	<div class="mui-content" style="background-color: #fff;">
        <div class="h-img">
        	<img src="__STATIC__/mobile/img/dt.png" width="100%"/>
        </div>
        <ul class="mui-table-view">
         	<div class="gsgg">
        		<div id="" class="gs">
        			<img src="__STATIC__/mobile/img/cd-dt.png" style="width:1em;"/>&nbsp;&nbsp;<b>最新动态</b>
        		</div>
        	</div>
        	<volist name="data" id="vo">
             <li class="mui-table-view-cell" _href="{:url('Dynamic/detail',array('id'=>$vo['id']))}" onclick="parent.setpage($(this))">
                  <div>
                      {$vo.title}
                  </div>
                  <div>
                  	  {$vo.create_time}
                  </div>
             </li>
            </volist>
		</ul>
		<if condition="$click_for_more">
            <div id="click_for_more" class="div-jz" style="text-align:center" page="1">
                <button>点击加载更多</button>
            </div>
        </if> 
    </div>

    <script>	
    	$("#click_for_more").click(function(){
	        var page=$(this).attr('page');
	        page = parseInt(page);
	        page += 1;

	        var formData = new FormData();
	        formData.append('page',page);

	        var index = parent.wait();
	        $.ajax({
	            url:"{:url('Dynamic/ajax_page')}",
	            type:'POST',
	            data:formData,
	            async:false,
	            processData:false,
	            contentType:false,
	            success:function(result){
	                parent.close_wait(index);
	                if(result.msg.length == 0){
	                    $("#click_for_more").remove();
	                    return false;
	                }else{
	                    $("#click_for_more").attr('page',page);
	                }

	                var html = '';
	                for(var i=0;i<result.msg.length;i++){
	                    html +='<li class="mui-table-view-cell" _href="'+result.msg[i].url+'" onclick="parent.setpage($(this))">';
		                html +='<div>';
		                html += result.msg[i].title;
		                html += '</div>';
		                html += '<div>';
		                html += result.msg[i].create_time;
		                html += '</div>';
		                html += '</li>';
	                }

	                $('.mui-table-view').append(html);
	            }
	        });

	    });
    </script>
</body>
</html>